package jacker.bit.price;

import org.json.JSONObject;

import android.content.Context;

public class PlatformFxbtc implements Platform {

	@Override
	public String getCode() {
		return "fxbtc";
	}

	@Override
	public String getName(Context ctx) {
		return "FXBTC";
	}

	@Override
	public float getPrice() throws Exception{
		String result = PriceChecker.httpGet("http://data.fxbtc.com/api?op=query_ticker&symbol=btc_cny");
		JSONObject json = new JSONObject(result);
		return Float.parseFloat(json.getJSONObject("ticker").getString("last_rate"));
	}

	@Override
	public String getCurrency() {
		// TODO Auto-generated method stub
		return "¥";
	}
	
	

}
